/*     */ package dm.jdbc.dbaccess;
/*     */ 
/*     */ import java.sql.SQLException;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ class SymmCipherDesc
/*     */ {
/*     */   private static final String DEFAULT_PADDING_TYPE = "PKCS5Padding";
/*     */   private static final String NO_PADDING_TYPE = "NoPadding";
/*  22 */   private int algorithmType = -1;
/*     */   
/*  24 */   private int work_mode = -1;
/*     */   
/*  26 */   private String algorithmFullName = null;
/*     */   
/*     */ 
/*  29 */   private String algorithmName = null;
/*     */   
/*  31 */   private int keyLength = -1;
/*     */   
/*  33 */   private int ivLength = -1;
/*     */   
/*     */   protected SymmCipherDesc(int algorithmID) throws SQLException
/*     */   {
/*  37 */     StringBuffer algorithmNameT = new StringBuffer();
/*  38 */     this.algorithmType = (algorithmID & 0xFF80);
/*  39 */     this.work_mode = (algorithmID & 0x7F);
/*     */     
/*  41 */     switch (this.algorithmType) {
/*     */     case 512: 
/*  43 */       algorithmNameT.append("AES");
/*  44 */       this.keyLength = 16;
/*  45 */       this.ivLength = 16;
/*  46 */       break;
/*     */     case 1024: 
/*  48 */       algorithmNameT.append("AES");
/*  49 */       this.keyLength = 24;
/*  50 */       this.ivLength = 16;
/*  51 */       break;
/*     */     case 2048: 
/*  53 */       algorithmNameT.append("AES");
/*  54 */       this.keyLength = 32;
/*  55 */       this.ivLength = 16;
/*  56 */       break;
/*     */     case 128: 
/*  58 */       algorithmNameT.append("DES");
/*  59 */       this.keyLength = 8;
/*  60 */       this.ivLength = 8;
/*  61 */       break;
/*     */     case 256: 
/*  63 */       algorithmNameT.append("DESEDE");
/*  64 */       this.keyLength = 16;
/*  65 */       this.ivLength = 8;
/*  66 */       break;
/*     */     case 4096: 
/*  68 */       this.keyLength = 16;
/*  69 */       algorithmNameT.append("RC4");
/*  70 */       break;
/*     */     default: 
/*  72 */       DBError.throwSQLException(6069);
/*     */     }
/*     */     
/*     */     
/*  76 */     this.algorithmName = algorithmNameT.toString();
/*     */     
/*  78 */     if (4096 == this.algorithmType) {
/*  79 */       this.algorithmFullName = algorithmNameT.toString();
/*  80 */       return;
/*     */     }
/*     */     
/*  83 */     algorithmNameT.append("/");
/*     */     
/*  85 */     switch (this.work_mode) {
/*     */     case 1: 
/*  87 */       algorithmNameT.append("ECB");
/*  88 */       algorithmNameT.append("/");
/*  89 */       algorithmNameT.append("PKCS5Padding");
/*  90 */       break;
/*     */     case 2: 
/*  92 */       algorithmNameT.append("CBC");
/*  93 */       algorithmNameT.append("/");
/*  94 */       algorithmNameT.append("PKCS5Padding");
/*  95 */       break;
/*     */     case 4: 
/*  97 */       algorithmNameT.append("CFB");
/*  98 */       algorithmNameT.append("/");
/*  99 */       algorithmNameT.append("NoPadding");
/* 100 */       break;
/*     */     case 8: 
/* 102 */       algorithmNameT.append("OFB");
/* 103 */       algorithmNameT.append("/");
/* 104 */       algorithmNameT.append("NoPadding");
/* 105 */       break;
/*     */     case 3: case 5: case 6: case 7: default: 
/* 107 */       DBError.throwSQLException(6069);
/*     */     }
/*     */     
/*     */     
/* 111 */     this.algorithmFullName = algorithmNameT.toString();
/*     */   }
/*     */   
/*     */   protected String getAlgorithmFullName() {
/* 115 */     return this.algorithmFullName;
/*     */   }
/*     */   
/*     */   protected int getIvLength() {
/* 119 */     return this.ivLength;
/*     */   }
/*     */   
/*     */   protected int getKeyLength() {
/* 123 */     return this.keyLength;
/*     */   }
/*     */   
/*     */   protected String getAlgorithmName() {
/* 127 */     return this.algorithmName;
/*     */   }
/*     */   
/*     */   protected int getWork_mode() {
/* 131 */     return this.work_mode;
/*     */   }
/*     */   
/*     */   protected int getAlgorithmType() {
/* 135 */     return this.algorithmType;
/*     */   }
/*     */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\dm\jdbc\dbaccess\SymmCipherDesc.class
 * Java compiler version: 2 (46.0)
 * JD-Core Version:       0.7.1
 */